package com.yiwyn;

import com.yiwyn.domain.People;
import com.yiwyn.utils.WrapUtil;
import lombok.extern.slf4j.Slf4j;

import java.util.ArrayList;
import java.util.List;

@Slf4j
public class WrapTraceIdDemo {

    public static void main(String[] args) {

        List<People> peopleList = new ArrayList<>();

        peopleList.add(new People() {{
            setName("A");
        }});
        peopleList.add(new People() {{
            setName("B");
        }});
        peopleList.add(new People() {{
            setName("C");
        }});
        peopleList.add(new People() {{
            setName("D");
        }});

        for (People people : peopleList) {
            WrapUtil.trace(people::getName, () -> {
                log.info("People信息:{}", people);
            });
        }

    }

}
